/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "物体节点构建.h"

#include <节点/物体/物体节点.h>
#include <节点/物体/动画点.h>
#include <节点/物体/蒙皮骨骼.h>
#include <节点/物体/灯光节点.h>

#include <节点/插座/list/list物体插座.h>





static C_外部加载物体节点* g_物体加载节点 = nullptr;





static void on_参数修改更新节点(S_Props& prop) {
	//switch ((*(S_PropValueEnum*)prop.m_Value).m_当前选项)
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);
	}
	//f_global_get激活节点后端
}


static void on_加载模型更新节点(S_Props& prop) {
	E_对话框类型 类型 = E_对话框类型::e_读取;

	//auto nodes = f_global_get激活节点();
	//for (auto 节点 : nodes) {
	//	C_外部加载物体节点* node = dynamic_cast<C_外部加载物体节点*>(节点);
	//	if (node) {
	//		if (f_prop_Bool(node->m_是否递归目录)) {
	//			类型 = E_对话框类型::e_打开路径;
	//			break;
	//		}
	//	}
	//}
	//
	//f_ui_set路径编辑框对话框类型(prop.m_UI->m_部件, 类型);
	//f_ui_set路径编辑框对话框过滤后缀(prop.m_UI->m_部件, {L".fbx", L".obj"});
	//
	//if (f_ui_路径编辑框是否打开(prop.m_UI->m_部件)) {
	//	for (auto 节点 : nodes) {
	//		节点->f_set是否要更新(true);
	//	}
	//}
	
}

static void on_重写加载模型_更新节点(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		dynamic_cast<C_外部加载物体节点*>(节点)->f_set是否要更新(true);
		dynamic_cast<C_外部加载物体节点*>(节点)->m_重写加载 = (true);
	}
}


static void on_区域光参数修改更新节点(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		C_区域光节点* 区域光节点 = dynamic_cast<C_区域光节点*>(节点);
		区域光节点->f_切换区域光形状();
		节点->f_set是否要更新(true);
	}
}






static void f_物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_物体节点* node = dynamic_cast<C_物体节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_物体类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_物体类型);

	node->m_物体显示模式.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_物体显示模式);

	node->m_物体名称.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_物体名称);

	plane->f_构建属性部件(props);

}

C_节点面板* f_节点构建_物体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_物体节点(ctx_3d);
		node->m_ICO = u"ico平面网格0016";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_物体节点(plane, node);

	return plane;
}

void f_节点重置_物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_物体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}





static void f_引用物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_引用物体节点* node = dynamic_cast<C_引用物体节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_查找名称.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_查找名称);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_引用物体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_引用物体节点(ctx_3d);
		node->m_ICO = u"警告";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_引用物体节点(plane, node);
	return plane;
}

void f_节点重置_引用物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_引用物体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_天空物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_天空节点* node = dynamic_cast<C_天空节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_天空大小.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_天空大小);

	node->m_天空类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_天空类型);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_天空物体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_天空节点(ctx_3d);
		node->m_ICO = u"ico_材质0001";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_天空物体节点(plane, node);
	return plane;
}

void		f_节点重置_天空物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_天空物体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_取物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_取物体节点* node = dynamic_cast<C_取物体节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	//node->m_物体类型.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_物体类型);
	plane->f_构建属性部件(props);
}


C_节点面板* f_节点构建_取物体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_引用物体节点(ctx_3d);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_取物体节点(plane, node);
	return plane;
}

void f_节点重置_取物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_取物体节点_部件构建属性;
	plane->m_ICO = u"警告";
}



static void f_查找子物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_查找子物体节点* node = dynamic_cast<C_查找子物体节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_查找类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_查找类型);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_查找子物体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_查找子物体节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_查找子物体节点(plane, node);
	return plane;
}

void f_节点重置_查找子物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_查找子物体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_物体父子关系_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_物体父子关系节点* node = dynamic_cast<C_物体父子关系节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	
	node->m_父子变换关系类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_父子变换关系类型);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_物体父子关系节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_物体父子关系节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_物体父子关系节点(plane, node);
	return plane;
}

void f_节点重置_物体父子关系节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_物体父子关系_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_设置物体数据_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体数据节点* node = dynamic_cast<C_设置物体数据节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体数据节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_设置物体数据节点(ctx_3d);	
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体数据节点(plane, node);
	return plane;
}

void f_节点重置_设置物体数据节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_设置物体数据_部件构建属性;
	plane->m_ICO = u"objects";
}









static void f_物体拷贝_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_物体拷贝节点* node = dynamic_cast<C_物体拷贝节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_物体拷贝节点(S_UI渲染环境& ctx, S_设备环境& view_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_物体拷贝节点(view_ctx);

	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_物体拷贝节点(plane, node);
	return plane;
}

void f_节点重置_物体拷贝节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_物体拷贝_部件构建属性;
	plane->m_ICO = u"defraggler";
}




static void f_创建物体实例节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_创建物体实例节点* node = dynamic_cast<C_创建物体实例节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_实例方式.m_UI->m_Update = f_节点参数更新;
	props.push_back(node->m_实例方式);

	node->m_开启实例材质.m_UI->m_Update = f_节点参数更新;
	props.push_back(node->m_开启实例材质);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_创建物体实例(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_创建物体实例节点(ctx_3d);
		node->m_ICO = u"ico球体0002";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_创建物体实例(plane, node);
	return plane;
}

void f_节点重置_创建物体实例(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_创建物体实例节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_对称物体_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_物体对称节点* node = dynamic_cast<C_物体对称节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_对称轴.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_对称轴);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_对称物体节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_物体对称节点(view3D_ctx);
		node->m_ICO = u"ico_对称0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_对称物体节点(plane, node);

	return plane;
}

void f_节点重置_对称物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_对称物体_部件构建属性;
	plane->m_ICO = node->m_ICO;
}





static void f_取物体属性_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_取物体属性节点* node = dynamic_cast<C_取物体属性节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_取物体属性节点(S_UI渲染环境& ctx, S_设备环境& view_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_取物体属性节点(view_ctx);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_取物体属性节点(plane, node);

	return plane;
}

void f_节点重置_取物体属性节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_取物体属性_部件构建属性;
	plane->m_ICO = u"objects";
}



static void f_取物体变换节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_取物体变换节点* node = dynamic_cast<C_取物体变换节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_取物体变换节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_取物体变换节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_取物体变换节点(plane, node);
	return plane;
}

void f_节点重置_取物体变换节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_取物体变换节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_取物体矩阵节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_取物体矩阵节点* node = dynamic_cast<C_取物体矩阵节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_取物体矩阵节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_取物体矩阵节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_取物体矩阵节点(plane, node);
	return plane;
}

void f_节点重置_取物体矩阵节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_取物体矩阵节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}








static void f_设置物体矩阵_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体矩阵节点* node = dynamic_cast<C_设置物体矩阵节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_设置方式.m_UI->m_Update = f_节点参数更新;
	props.push_back(node->m_设置方式);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体矩阵节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体矩阵节点(view3D_ctx);
		node->m_ICO = u"icoVec3_1D0006";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体矩阵节点(plane, node);
	return plane;
}

void f_节点重置_设置物体矩阵节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_设置物体矩阵_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_物体绑定骨骼_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体矩阵节点* node = dynamic_cast<C_设置物体矩阵节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_物体绑定骨骼节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_物体绑定骨骼节点(view3D_ctx);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_物体绑定骨骼节点(plane, node);
	return plane;
}
void f_节点重置_物体绑定骨骼节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_物体绑定骨骼_部件构建属性;
	plane->m_ICO = u"defraggler";
}





void f_PropUpdate_物体变换(S_Props& prop) {

}

static void f_设置物体变换节点_3D视口更新(C_节点面板* node, S_Scene* scene) {
	C_设置物体变换节点* 节点 = dynamic_cast<C_设置物体变换节点*>(node->m_NodeData);

}

static void f_设置物体变换_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体变换节点* node = dynamic_cast<C_设置物体变换节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_变换方式.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_变换方式);

	node->m_物体模式.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_物体模式);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体变换节点(S_UI渲染环境& ctx, S_设备环境& view_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体变换节点(view_ctx);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体变换节点(plane, node);

	return plane;
}

void f_节点重置_设置物体变换节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_设置物体变换_部件构建属性;
	plane->m_3D视口更新 = f_设置物体变换节点_3D视口更新;
	plane->m_ICO = node->m_ICO;
}




static void f_设置物体绕轴旋转节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体绕轴旋转节点* node = dynamic_cast<C_设置物体绕轴旋转节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_中心类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_中心类型);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体绕轴旋转节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体绕轴旋转节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体绕轴旋转节点(plane, node);
	return plane;
}

void f_节点重置_设置物体绕轴旋转节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_设置物体绕轴旋转节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_设置物体缩放节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体缩放节点* node = dynamic_cast<C_设置物体缩放节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_中心类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_中心类型);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体缩放节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体缩放节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体缩放节点(plane, node);
	return plane;
}

void f_节点重置_设置物体缩放节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_设置物体缩放节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_设置摄像机属性节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置摄像机属性节点* node = dynamic_cast<C_设置摄像机属性节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置摄像机属性节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置摄像机属性节点(ctx_3d);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置摄像机属性节点(plane, node);
	return plane;
}

void f_节点重置_设置摄像机属性节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_设置摄像机属性节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}







static void f_外部加载物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_外部加载物体节点* node = dynamic_cast<C_外部加载物体节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	bool 继续添加 = f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	if (继续添加) {
		props.push_back(node->m_是否递归目录);
		props.push_back(node->m_是否序列);
		
		node->m_Path.m_UI->m_Update = on_加载模型更新节点;
		props.push_back(node->m_Path);

		node->m_预缩放.m_UI->m_Update = on_重写加载模型_更新节点;
		props.push_back(node->m_预缩放);

		node->m_应用变换.m_UI->m_Update = on_重写加载模型_更新节点;
		props.push_back(node->m_应用变换);
	}
	
	plane->f_构建属性部件(props);

}

C_节点面板* f_节点构建_外部加载物体节点(S_UI渲染环境& ctx, S_设备环境& view_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_外部加载物体节点(view_ctx);
		node->m_ICO = u"ico_文件物体0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_外部加载物体节点(plane, node);
	return plane;
}

void f_节点重置_外部加载物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_外部加载物体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_加载模型节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_加载模型节点* node = dynamic_cast<C_加载模型节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	bool 继续添加 = f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	if (继续添加) {
		node->m_文件类型.m_UI->m_Update = on_参数修改更新节点;
		props.push_back(node->m_文件类型);
	}
	
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_加载模型节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_加载模型节点(ctx_3d);
		node->m_ICO = u"ico_文件模型0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_加载模型节点(plane, node);
	return plane;
}

void f_节点重置_加载模型节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_加载模型节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_骨骼节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_骨架节点* node = dynamic_cast<C_骨架节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_前端显示.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_前端显示);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_骨骼节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_骨架节点(ctx_3d);
		node->m_ICO = u"ico_骨骼0021";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_骨骼节点(plane, node);
	return plane;
}

void f_节点重置_骨骼节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_骨骼节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void on_骨头节点面板_属性构建(C_节点基类* 节点, std::vector<S_Props>& props) {
	C_骨头节点* node = dynamic_cast<C_骨头节点*>(节点);
	
	props.push_back(node->m_封套S内半径);
	node->m_封套S内半径.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_封套S外半径);
	node->m_封套S外半径.m_UI->m_Update = on_参数修改更新节点;

	props.push_back(node->m_封套E内半径);
	node->m_封套E内半径.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_封套E外半径);
	node->m_封套E外半径.m_UI->m_Update = on_参数修改更新节点;

}

static void f_骨头节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_骨头节点* node = dynamic_cast<C_骨头节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	on_骨头节点面板_属性构建(node, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_骨头节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_骨头节点(ctx_3d);
		node->m_ICO = u"ico_骨头0022";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_骨头节点(plane, node);
	return plane;
}

void f_节点重置_骨头节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_骨头节点_部件构建属性;
	plane->m_面板属性构建 = on_骨头节点面板_属性构建;
	plane->m_ICO = node->m_ICO;
}



static void f_骨骼IK节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_骨骼IK节点* node = dynamic_cast<C_骨骼IK节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	
	props.push_back(node->m_使用骨节);
	node->m_使用骨节.m_UI->m_Update = on_参数修改更新节点;

	props.push_back(node->m_迭代次数);
	node->m_迭代次数.m_UI->m_Update = on_参数修改更新节点;
	
	props.push_back(node->m_节数);
	node->m_节数.m_UI->m_Update = on_参数修改更新节点;

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_骨骼IK节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_骨骼IK节点(ctx_3d);
		node->m_ICO = u"ico_IK0023";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_骨骼IK节点(plane, node);
	return plane;
}

void f_节点重置_骨骼IK节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_骨骼IK节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void on_属性栏面板_属性构建(C_节点基类* 节点, std::vector<S_Props>& props) {
	C_蒙皮节点* node = dynamic_cast<C_蒙皮节点*>(节点);

	props.push_back(node->m_权重计算);
	node->m_权重计算.m_UI->m_Update = on_参数修改更新节点;

	props.push_back(node->m_封套长度);
	node->m_封套长度.m_UI->m_Update = on_参数修改更新节点;
}

static void f_蒙皮节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_蒙皮节点* node = dynamic_cast<C_蒙皮节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	
	on_属性栏面板_属性构建(node, props);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_蒙皮节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_蒙皮节点(ctx_3d);
		node->m_ICO = u"ico_蒙皮0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_蒙皮节点(plane, node);
	return plane;
}

void f_节点重置_蒙皮节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_蒙皮节点_部件构建属性;
	plane->m_面板属性构建 = on_属性栏面板_属性构建;
	plane->m_ICO = node->m_ICO;
}




static void f_摄像机节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_摄像机节点* node = dynamic_cast<C_摄像机节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	//props.push_back(node->m_自动权重);
	//node->m_自动权重.m_UI->m_Update = on_参数修改更新节点;

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_摄像机节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_摄像机节点(view3D_ctx);
		node->m_ICO = u"ico_相机0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_摄像机节点(plane, node);
	return plane;
}

void f_节点重置_摄像机节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_摄像机节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_目标摄像机节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_目标摄像机节点* node = dynamic_cast<C_目标摄像机节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	//props.push_back(node->m_自动权重);
	//node->m_自动权重.m_UI->m_Update = on_参数修改更新节点;

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_目标摄像机节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_目标摄像机节点(view3D_ctx);
		node->m_ICO = u"ico_相机0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_目标摄像机节点(plane, node);
	return plane;
}

void f_节点重置_目标摄像机节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_目标摄像机节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_物体虚拟体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_物体虚拟体节点* node = dynamic_cast<C_物体虚拟体节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	props.push_back(node->m_虚拟体网格类型);
	node->m_虚拟体网格类型.m_UI->m_Update = on_参数修改更新节点;

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_物体虚拟体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_物体虚拟体节点(ctx_3d);
		node->m_ICO = u"ico_虚拟体0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_物体虚拟体节点(plane, node);
	return plane;
}

void f_节点重置_物体虚拟体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_物体虚拟体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_点光源节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_点光源节点* node = dynamic_cast<C_点光源节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_灯光标志位.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_灯光标志位);
	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_点光源节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_点光源节点(view3D_ctx);
		node->m_ICO = u"ico_点灯亮0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_点光源节点(plane, node);
	return plane;
}
void f_节点重置_点光源节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_点光源节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}


static void on_面光源节点_属性构建(C_节点基类* 节点, std::vector<S_Props>& props) {
	C_区域光节点* node = dynamic_cast<C_区域光节点*>(节点);

	node->m_形状类型.m_UI->m_Update = on_区域光参数修改更新节点;
	props.push_back(node->m_形状类型);
	node->m_灯光标志位.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_灯光标志位);

	node->m_高光比.m_UI->m_Update = f_节点参数更新;
	props.push_back(node->m_高光比);
	
	node->m_高光.m_UI->m_Update = f_节点参数更新;
	props.push_back(node->m_高光);

	//return;
	node->m_阴影.m_UI->m_Update = f_节点参数更新_属性栏更新;
	props.push_back(node->m_阴影);

	if (f_prop_Bool(node->m_阴影)) {
		props.push_back(node->m_阴影纹理);

		node->m_阴影采样方式.m_UI->m_Update = f_节点参数更新;
		props.push_back(node->m_阴影采样方式);
		
		node->m_阴影纹理大小.m_UI->m_Update = f_节点参数更新;
		props.push_back(node->m_阴影纹理大小);
		
		node->m_阴影采样数量.m_UI->m_Update = f_节点参数更新;
		props.push_back(node->m_阴影采样数量);
		
		node->m_阴影模糊厚度.m_UI->m_Update = f_节点参数更新;
		props.push_back(node->m_阴影模糊厚度);

		node->m_阴影模糊长度.m_UI->m_Update = f_节点参数更新;
		props.push_back(node->m_阴影模糊长度);
	}
}

static void f_面光源节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_区域光节点* node = dynamic_cast<C_区域光节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	on_面光源节点_属性构建(node, props);

	//node->m_形状类型.m_UI->m_Update = on_区域光参数修改更新节点;
	//props.push_back(node->m_形状类型);
	//node->m_灯光标志位.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_灯光标志位);
	//
	//node->m_高光比.m_UI->m_Update = f_节点参数更新;
	//props.push_back(node->m_高光比);
	//
	//node->m_高光.m_UI->m_Update = f_节点参数更新;
	//props.push_back(node->m_高光);
	//
	//
	//node->m_阴影.m_UI->m_Update = f_节点参数更新_属性栏更新;
	//props.push_back(node->m_阴影);
	//
	//if (f_prop_Bool(node->m_阴影)) {
	//	props.push_back(node->m_阴影纹理);
	//
	//	props.push_back(node->m_阴影采样方式);
	//	node->m_阴影采样方式.m_UI->m_Update = f_节点参数更新;
	//
	//	props.push_back(node->m_阴影纹理大小);
	//	node->m_阴影纹理大小.m_UI->m_Update = f_节点参数更新;
	//
	//	props.push_back(node->m_阴影采样数量);
	//	node->m_阴影采样数量.m_UI->m_Update = f_节点参数更新;
	//
	//}

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_面光源节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_区域光节点(view3D_ctx);
		node->m_ICO = u"ico_点灯亮0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_面光源节点(plane, node);
	return plane;
}
void f_节点重置_面光源节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_面光源节点_部件构建属性;
	plane->m_面板属性构建 = on_面光源节点_属性构建;
	plane->m_ICO = node->m_ICO;
}



static void f_聚光灯节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_聚光灯节点* node = dynamic_cast<C_聚光灯节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_灯光标志位.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_灯光标志位);
	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_聚光灯节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_聚光灯节点(view3D_ctx);
		node->m_ICO = u"ico_点灯亮0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_聚光灯节点(plane, node);
	return plane;
}
void f_节点重置_聚光灯节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_聚光灯节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_平行光节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_平行光节点* node = dynamic_cast<C_平行光节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_灯光标志位.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_灯光标志位);
	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_平行光节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_平行光节点(view3D_ctx);
		node->m_ICO = u"ico_点灯亮0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_平行光节点(plane, node);
	return plane;
}
void f_节点重置_平行光节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_平行光节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_取物体材质节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_取物体材质节点* node = dynamic_cast<C_取物体材质节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_取物体材质节点(S_UI渲染环境& ctx, S_设备环境& view3D_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_取物体材质节点(view3D_ctx);
	//if (nullptr == plane) {
	//	plane = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_节点视图);
	//}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_平行光节点(plane, node);
	return plane;
}
void f_节点重置_取物体材质节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_取物体材质节点_部件构建属性;
	plane->m_ICO = u"ico_IK0023";
}




static void f_选择物体节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_选择物体节点* node = dynamic_cast<C_选择物体节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	props.push_back(node->m_物体列表);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_选择物体节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_选择物体节点(ctx_3d);
		node->m_ICO = u"ico编辑网格0014";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_选择物体节点(plane, node);
	return plane;
}

void f_节点重置_选择物体节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_选择物体节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}





static void f_设置物体中心节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体中心节点* node = dynamic_cast<C_设置物体中心节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	//node->m_中心方式.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_中心方式);
	//node->m_中心位置.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_中心位置);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体中心节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体中心节点(ctx_3d);
		node->m_ICO = u"ico编辑网格0014";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体中心节点(plane, node);
	return plane;
}

void f_节点重置_设置物体中心节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_设置物体中心节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_设置物体法线节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体法线节点* node = dynamic_cast<C_设置物体法线节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	//node->m_中心方式.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_中心方式);
	//node->m_中心位置.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_中心位置);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体法线节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体法线节点(ctx_3d);
		node->m_ICO = u"ico编辑网格0014";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体法线节点(plane, node);
	return plane;
}

void f_节点重置_设置物体法线节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_设置物体法线节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_设置物体绘制模式节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_设置物体绘制模式节点* node = dynamic_cast<C_设置物体绘制模式节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_绘制类型.m_UI->m_Update = on_参数修改更新节点;
	props.push_back(node->m_绘制类型);
	//node->m_中心位置.m_UI->m_Update = on_参数修改更新节点;
	//props.push_back(node->m_中心位置);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体绘制模式节点(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_设置物体绘制模式节点(ctx_3d);
		node->m_ICO = u"ico编辑网格0014";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体绘制模式节点(plane, node);
	return plane;
}

void f_节点重置_设置物体绘制模式节点(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_设置物体绘制模式节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




void f_物体节点_构建函数初始化() {
	C_节点面板::g节点面板构建函数[DEF_物体虚拟体节点] = f_节点构建_物体虚拟体节点;
	C_节点面板::g节点面板重置函数[DEF_物体虚拟体节点] = f_节点重置_物体虚拟体节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"虚拟体"] = DEF_物体虚拟体节点;

	C_节点面板::g节点面板构建函数[DEF_天空节点] = f_节点构建_天空物体节点;
	C_节点面板::g节点面板重置函数[DEF_天空节点] = f_节点重置_天空物体节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"天空"] = DEF_天空节点;

	C_节点面板::g节点面板构建函数[DEF_创建物体实例节点] = f_节点构建_创建物体实例;
	C_节点面板::g节点面板重置函数[DEF_创建物体实例节点] = f_节点重置_创建物体实例;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"创建物体实例"] = DEF_创建物体实例节点;

	C_节点面板::g节点面板构建函数[DEF_设置物体中心节点] = f_节点构建_设置物体中心节点;
	C_节点面板::g节点面板重置函数[DEF_设置物体中心节点] = f_节点重置_设置物体中心节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"设置物体中心"] = DEF_设置物体中心节点;

	C_节点面板::g节点面板构建函数[DEF_设置物体法线节点] = f_节点构建_设置物体法线节点;
	C_节点面板::g节点面板重置函数[DEF_设置物体法线节点] = f_节点重置_设置物体法线节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"设置物体法线"] = DEF_设置物体法线节点;

	C_节点面板::g节点面板构建函数[DEF_设置物体绕轴旋转节点] = f_节点构建_设置物体绕轴旋转节点;
	C_节点面板::g节点面板重置函数[DEF_设置物体绕轴旋转节点] = f_节点重置_设置物体绕轴旋转节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"物体绕轴旋转"] = DEF_设置物体绕轴旋转节点;

	C_节点面板::g节点面板构建函数[DEF_设置物体缩放节点] = f_节点构建_设置物体缩放节点;
	C_节点面板::g节点面板重置函数[DEF_设置物体缩放节点] = f_节点重置_设置物体缩放节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"设置物体缩放"] = DEF_设置物体缩放节点;

	C_节点面板::g节点面板构建函数[DEF_设置物体绘制模式节点] = f_节点构建_设置物体绘制模式节点;
	C_节点面板::g节点面板重置函数[DEF_设置物体绘制模式节点] = f_节点重置_设置物体绘制模式节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"设置绘制模式"] = DEF_设置物体绘制模式节点;

	C_节点面板::g节点面板构建函数[DEF_设置物体绘制模式节点] = f_节点构建_设置物体绘制模式节点;
	C_节点面板::g节点面板重置函数[DEF_设置物体绘制模式节点] = f_节点重置_设置物体绘制模式节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"设置绘制模式"] = DEF_设置物体绘制模式节点;


	C_节点面板::g节点面板构建函数[DEF_骨骼蒙皮节点] = f_节点构建_蒙皮节点;
	C_节点面板::g节点面板重置函数[DEF_骨骼蒙皮节点] = f_节点重置_蒙皮节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"骨骼蒙皮"] = DEF_骨骼蒙皮节点;


	C_节点面板::g节点面板构建函数[DEF_物体对称节点] = f_节点构建_对称物体节点;
	C_节点面板::g节点面板重置函数[DEF_物体对称节点] = f_节点重置_对称物体节点;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"物体对称"] = DEF_物体对称节点;


}



bool f_物体节点重构(C_节点面板** plane, C_节点基类* node, S_UI渲染环境* ctx) {
	if (node->m_TypeName == "物体节点") {
		if (!plane[0]) plane[0] = f_节点构建_物体节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_物体节点(plane[0], node);
	}
	else if (node->m_TypeName == "取物体属性节点") {
		if (!plane[0]) plane[0] = f_节点构建_取物体属性节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_取物体属性节点(plane[0], node);
	}
	else if (node->m_TypeName == DEF_取物体材质节点) {
		if (!plane[0]) plane[0] = f_节点构建_取物体材质节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_取物体材质节点(plane[0], node);
	}
	else if (node->m_TypeName == "物体拷贝节点") {
		if (!plane[0]) plane[0] = f_节点构建_物体拷贝节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_物体拷贝节点(plane[0], node);
	}
	else if (node->m_TypeName == "物体对称节点") {
		if (!plane[0]) plane[0] = f_节点构建_对称物体节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_对称物体节点(plane[0], node);
	}
	else if (node->m_TypeName == "设置物体矩阵节点") {
		if (!plane[0]) plane[0] = f_节点构建_设置物体矩阵节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_设置物体矩阵节点(plane[0], node);
	}
	else if (node->m_TypeName == "设置物体变换节点") {
		if (!plane[0]) plane[0] = f_节点构建_设置物体变换节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_设置物体变换节点(plane[0], node);
	}
	else if (node->m_TypeName == "物体绑定骨骼节点") {
		if (!plane[0]) plane[0] = f_节点构建_物体绑定骨骼节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_物体绑定骨骼节点(plane[0], node);
	}
	else if (node->m_TypeName == "外部加载物体节点") {
		if (!plane[0]) plane[0] = f_节点构建_外部加载物体节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_外部加载物体节点(plane[0], node);
	}
	else if (node->m_TypeName == "骨骼节点") {
		if (!plane[0]) plane[0] = f_节点构建_骨骼节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_骨骼节点(plane[0], node);
	}
	else if (node->m_TypeName == "骨头节点") {
		if (!plane[0]) plane[0] = f_节点构建_骨头节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_骨头节点(plane[0], node);
	}
	else if (node->m_TypeName == "骨骼IK节点") {
		if (!plane[0]) plane[0] = f_节点构建_骨骼IK节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_骨骼IK节点(plane[0], node);
	}
	else if (node->m_TypeName == "蒙皮节点") {
		if (!plane[0]) plane[0] = f_节点构建_蒙皮节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_蒙皮节点(plane[0], node);
	}

	else if (node->m_TypeName == DEF_平行光节点) {
		if (!plane[0]) plane[0] = f_节点构建_平行光节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_平行光节点(plane[0], node);
	}
	else if (node->m_TypeName == DEF_聚光灯节点) {
		if (!plane[0]) plane[0] = f_节点构建_聚光灯节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_聚光灯节点(plane[0], node);
	}
	else if (node->m_TypeName == DEF_点光源节点) {
		if (!plane[0]) plane[0] = f_节点构建_点光源节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_点光源节点(plane[0], node);
	}
	else if (node->m_TypeName == DEF_区域光节点) {
		if (!plane[0]) plane[0] = f_节点构建_面光源节点(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_面光源节点(plane[0], node);
	}

	else {
		return false;
	}

	return true;
}











